package com.sumec.controller;

import com.sumec.client.Client;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SyncController {
    @Autowired
    private Client client;

    @RequestMapping("/hello")
    public String hello(String username) {
        return "hello" + username;
    }

    @RequestMapping("/reg")
    public String register(String username, String password, String email) {
        String res = client.ucUserRegister(username,password,email);
        return res;
    }

    @RequestMapping("/get")
    public String getUser(String username) {
        String res = client.ucGetUser(username,0);
        return res;
    }

    @RequestMapping("/login")
    public String login(String username) {
        String res = client.ucGetUser(username,0);
        return res;
    }
}
